//
//  NewInformationTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/13.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "NewInformationTableViewCell.h"
//#import "wkweb"

@implementation NewInformationTableViewCell
{
    GLGWView *baV;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
    
        GLGWView *view = [[GLGWView alloc] initWithInSuperView:self.contentView];
//        view.backgroundColor = kRandomColor;
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.equalTo(self.contentView);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(100 + 47)));
        }];
        baV = view;
        UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(100))];
        web.backgroundColor = kRandomColor;
        [view addSubview:web];
        self.webV = web;
        
        GLGWView *bottomV = [[GLGWView alloc] initWithInSuperView:self.contentView];
        [bottomV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self.contentView);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(44)));
        }];
        GLGWLabel *leftLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:bottomV];
        NSString *str = @" 3";
        leftLab.attributedText = [GLGWLabel addImageName:@"icon_yanjing" theImageFram:CGRectMake(0, -3, kWidthProportion_In_iPhoneTriploid(20), kHeightProportion_In_iPhoneTriploid(14)) theTextString:str atImageIndex:0];
        [leftLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(bottomV.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.centerY.equalTo(bottomV.mas_centerY);
        }];
        
        GLGWButton *rightBtn = [[GLGWButton alloc] initWithTitle:@"43" titleLableFont:SYSTEMFONT(14) titleLableColor:[UIColor colorWithHexString:@"#666666"] inSuperView:bottomV];
        [rightBtn setImage:[UIImage imageNamed:@"icon_shoucang_kongxin"] forState:UIControlStateNormal];
        [rightBtn setImagePositionWithType:SSImagePositionTypeLeft spacing:5];
        [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(@(-kWidthProportion_In_iPhoneTriploid(14)));
            make.centerY.equalTo(leftLab.mas_centerY);
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(150)));
        }];
        [rightBtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
        [rightBtn addTarget:self action:@selector(rightAction:) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return self;
}

- (void)rightAction:(GLGWButton *)sender
{
    if (self.BlockLikeBtn) {
        self.BlockLikeBtn(sender);
    }
}

@end
